package edu.uoc.tdp.pac4.proves.gui;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;

import edu.uoc.tdp.pac4.connexiomanteniment.ResponsableEvents;
import edu.uoc.tdp.pac4.i18n.TDSLanguageUtils;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import java.awt.SystemColor;
import javax.swing.ImageIcon;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;

public class PantallaCierreInscripciones extends JFrame {
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private ResponsableEvents usuario;
	private JTable table;
	

	/**
	 * Create the frame.
	 * @throws UnsupportedLookAndFeelException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException 
	 */
	public PantallaCierreInscripciones() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		
		this.usuario = usuario;
		
		//Cargamos el gestor de mensajes 
		TDSLanguageUtils.setDefaultLanguage("edu.uoc.tdp.pac4.i18n/messages");
		
		initComponents();
		
	}

	private void initComponents(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 658, 508);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setBackground(Color.WHITE);
		panel.setBounds(0, 0, 642, 69);
		contentPane.add(panel);
		
		JLabel label_1 = new JLabel("");
		label_1.setIcon(new ImageIcon(PantallaCierrePruebas.class.getResource("/images/logo.png")));
		label_1.setBounds(17, 6, 93, 59);
		panel.add(label_1);
		
		JLabel label = new JLabel(TDSLanguageUtils.getMessage("PantallaCierreInscripciones.label.titulo"));
		label.setForeground(SystemColor.textHighlight);
		label.setFont(new Font("Calibri", Font.BOLD, 26));
		label.setBounds(138, 21, 452, 26);
		panel.add(label);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 80, 622, 334);
		contentPane.add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null},
			},
			new String[] {
					TDSLanguageUtils.getMessage("PantallaCierreInscripciones.tabla.col1"), 
					TDSLanguageUtils.getMessage("PantallaCierreInscripciones.tabla.col2"), 
					TDSLanguageUtils.getMessage("PantallaCierreInscripciones.tabla.col3"),
					TDSLanguageUtils.getMessage("PantallaCierreInscripciones.tabla.col4")
			}
		));
		scrollPane.setViewportView(table);
		
		JButton btnBuscar = new JButton(TDSLanguageUtils.getMessage("PantallaCierreInscripciones.boton.buscar"));
		btnBuscar.setBounds(10, 436, 89, 23);
		contentPane.add(btnBuscar);
		
		JButton btnCerrarCompeticin = new JButton(TDSLanguageUtils.getMessage("PantallaCierreInscripciones.boton.cerrarinscripciones"));
		btnCerrarCompeticin.setBounds(383, 436, 138, 23);
		contentPane.add(btnCerrarCompeticin);
		
		JButton btnSalir = new JButton(TDSLanguageUtils.getMessage("PantallaCierreInscripciones.boton.salir"));
		btnSalir.setBounds(543, 436, 89, 23);
		contentPane.add(btnSalir);
	}
}
